import geopandas as gpd
import pandas as pd
import datetime

gdf_r=gpd.read_file('E:/时空数据分析/road_w.geojson')
gdf=gpd.read_file('E:/时空数据分析/基础数据.geojson')
print(gdf_r.head())
gdf_gb = gdf_r['meanLength'].groupby([gdf_r['GWBH_500']]).mean()
print(gdf_gb.head())
gdf = gdf(gdf_gb[1])#['GWBH_500','meanLength']
gdf.to_file('E:/时空数据分析/road_grid_w.geojson',driver='GeoJSON', encoding='utf-8')
print(gdf)
